<template>
	<view class="Menu">
		<!-- 导航条 :style="{ height: $wanlshop.wanlsys().height + 'px' }"-->
		<view class="cu-custom">
			<view class="cu-bar fixed" style="background: #fff;"
				:style="{height: $wanlshop.wanlsys().height + 'px',paddingTop: $wanlshop.wanlsys().top + 'px',}">
				<view class="action">
					<!-- <text class="wlIcon-fanhui1" style="margin-left: 0" @tap="$wanlshop.back(1)"></text> -->
				</view>
				<view class="content">
					<view v-for="(item,index) in list" :key="index" :class="current==index?'active':''"
						@click="sectionChange(index)">
						{{item}}
					</view>
				</view>
				<view class="action" @click="GoOrder">
					<!-- 我的订单 -->
					{{$t('otcTransaction.but.my-order')}}
					<!-- <text class="wlIcon-gengduo" @tap="showModal('share')"></text> -->
				</view>
			</view>
		</view>
		<view>
			<Purchase v-if="current==0" />
			<Sellout v-else></Sellout>
		</view>
	</view>
</template>
<script>
	import Purchase from "./purchase.vue";
	import Sellout from "./sellout.vue";
	export default {
		components: {
			Purchase,
			Sellout,
		},
		data() {
			return {
				list: [this.$t('otcTransaction.navbar.buy'), this.$t('otcTransaction.navbar.sell')], //['购买', '出售'],
				current: 0,
			};
		},
		onShow() {

		},
		onLoad(option) {
			if (option && option.id) {
				this.current = option.id
			} else {
				this.current = 0
			}
		},
		methods: {

			sectionChange(index) {
				this.current = index;
			},
			//我的订单
			GoOrder() {
				this.$wanlshop.to("/pages/newPage/moneyDealList");
			}
		}
	};
</script>

<style lang="scss">
	.Menu {
		background: #f8f8f8;

		.content {
			display: flex;
			align-items: center;
			background: #F7F7F7;
			border-radius: 50rpx;
			padding: 4rpx;
			font-weight: 400;
			font-size: 28rpx;
			color: #666666;

			uni-view {
				width: 50%;
				border-radius: 50rpx;
			}

			.active {
				background: #FF443C;
				color: #fff;
			}
		}

		.action {
			font-size: 24rpx;
			color: #999999;
		}

	}
</style>